home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_02_11
/
2n11025a
< prev
next >
Wrap
Text File
|
1991-09-11
|
1KB
|
50 lines
/*
* LISTING 4
*
* bfile.h
* Header for block-based file i/o interface routines
*
* Source code Copyright (c) 1991 T.W. Nelson. May be
* used only for non-commercial purposes with
* appropriate acknowledgement of copyright.
*/
#ifndef __BFILE_H
#define __BFILE_H
#ifndef __BCACHE_H
#include "bcache.h"
#endif
#define MAXPATHNAME 80
//descriptor object for a block-cached file ...
typedef struct {
char fname[MAXPATHNAME]; //path, file name
int fd; //DOS file descriptor
size_t mode; //mode and/or status flags
BCACHE cac; //cache descriptor
} BFILE;
//values for 'mode' field in BFILE object .......
#define IS_OPEN 0x0001 //open_b() successful
#define WRITE_THRU 0x0002 //write-thru strategy
//prototypes ..........
BFILE *open_b( const char *path, int bmax,
int bsize, int mode );
int read_b ( BFILE *ff, void *buf, ulong blockno );
int write_b( BFILE *ff, void *buf, ulong blockno );
int close_b( BFILE *ff );
//prototypes from emm module (emm.c) ....
void emm_setflag( int flag );
void emm_map_pages( BCACHE *cp );
void emm_unmap_pages( BCACHE *cp );
int emm_allocate( BCACHE *cp, int flag );
int emm_check( void );
#endif //__BFILE_H
/* ---- End of File -------------------------------- */